package com.learn;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.servlet.http.HttpServletRequest;

@SpringBootApplication
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@EnableTransactionManagement
@ComponentScan("com.learn.*")
@Slf4j
public class LearnApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(LearnApplication.class, args);
        log.info("~~~~~~~~~~~~~~~~~项目启动完成~~~~~~~~~~~~~~~~~");
        log.error("@@@@@@欢迎使用学习平台@@@@@@");
    }

    //为了打包springboot项目
    @Override
    protected SpringApplicationBuilder configure(
            SpringApplicationBuilder builder) {
        return builder.sources(this.getClass());
    }
}
